<!DOCTYPE html>
<html lang="zh-cn">

<head>
    <meta charset="UTF-8">
    <title>数据管理系统</title>
    <meta name="keywords" content="腐蚀数据,腐蚀与防护,中国腐蚀与防护平台" />
    <meta name="description"
        content="中国腐蚀与防护网是国家级的腐蚀与防护专业网站。我们向用户提供公益性的腐蚀数据，定制化防腐技术，以及全方位的防腐资讯。我们拥有我国最权威、最全面、最快捷的材料腐蚀（老化）数据共享服务平台；我们分享行业动态、专业知识、防护技术、文献资料、科研成果等信息资源；我们提供科学数据、环境试验、检测分析、技术咨询及成果推广全方位服务。" />
    <link rel="stylesheet" type="text/css" href="/static/css/reset_1.css" />
    <link rel="stylesheet" type="text/css" href="/static/css/index.css" />
    <link rel="stylesheet" type="text/css" href="/static/css/index_fs.css" />
    <script type="text/javascript" src="/static/js/jquery-2.1.1.min.js"></script>
</head>

<body>
    <!--logo-->
    <div class="header inner_c">
        <h1><a href="http://www.ecorr.org/" target="_blank" title="中国腐蚀与防护网" title="中国腐蚀与防护网">中国腐蚀与防护网</a></h1>
    </div>
    <!--logo 结束-->

    <!--搜索div-->
    <div class="search inner_c">
        <form action="/datalist.html" accept-charset="utf-8" class="search" id="dw__search" method="get" role="search"
            target="_blank">
            <input id="search-box" type="text" name="q" accesskey="f" class="places-autocomplete fl"
                placeholder="请输入关键字">
            <div class="leimu fl">
                <select class="datepicker" id="sel_Sub" name="classid">
                    <option value="">请选数据表</option>
                </select>
			</div>
            <div class="btn btn-jp-green fl" id="search_button">搜&nbsp;&nbsp;&nbsp;索</div>
        </form>
        <!-- 隐藏的earror div -->
        <div id="errmsg"></div>
        <!-- 隐藏的earror div 结束-->
    </div>
    <!--搜索div 结束-->

    <!--banner图-->
    <div class="banner">
        <div class="h52 cl inner_c"></div>
        <div class="h120 inner_c"></div>
    </div>
    <!--banner图 结束-->

    <!--主体内容-->
    <div class="m_main inner_c">

        <!-- 腐蚀数据 -->
        <div class="con_block">
            <div class="m_col fl">
                <h1 class="m_tit">腐蚀数据</h1>
                <div class="m_col_con" id="fssj">

                </div>
            </div>
        </div>

        <!-- 环境数据 -->
        <div class="con_block">
            <div class="m_col">
                <h1 class="m_tit">环境数据 <a class="m_tit_more" href="edataclass.html?classid=176" target="_blank">更多>></a>
                </h1>
                <div class="m_col_con" id="hjsj">
                    <ul class="clsj">

                    </ul>
                </div>
            </div>
        </div>

        <!-- 专题数据 -->
        <div class="con_block">
            <div class="m_col fl">
                <h1 class="m_tit">专题数据<a class="m_tit_more" href="edataclass.html?classid=416" target="_blank">更多>></a>
                </h1>
                <div class="m_col_con" id="ztsj" style="overflow:hidden;">

                </div>
            </div>
        </div>

        <!-- 腐蚀调查 -->
        <div class="con_block">
            <div class="m_col fl">
                <h1 class="m_tit">腐蚀调查</h1>
                <div class="m_col_con" id="fsdc">

                </div>
            </div>
        </div>

        <div class="con_block">
            <div class="m_col2 fl">
                <h1 class="m_tit">材料数据</h1>
                <div class="m_col_con" id="clsj">
                    <ul class="clsj" style=" width:300px; height:170px;">

                    </ul>
                </div>
            </div>
            <div class="m_col2 fl">
                <h1 class="m_tit">基础数据<a class="m_tit_more" href="edataclass.html?classid=265" target="_blank">更多>></a>
                </h1>
                <div class="m_col_con" id="jcsj">
                    <div class="m_con_child fl" style="border-right:none; margin-right:0; width:300px; height:170px;">
                        <ul class="m_con_list">

                        </ul>
                    </div>
                </div>
            </div>
            <div class="m_col2 fl">
                <h1 class="m_tit">实验数据<a class="m_tit_more" href="edataclass.html?classid=177" target="_blank">更多>></a>
                </h1>
                <div class="m_col_con" id="sysj">
                    <div class="m_con_child fl" style="border-right:none; margin-right:0; width:300px; height:170px;">
                        <ul class="m_con_list">

                        </ul>
                    </div>
                </div>
            </div>
        </div>

        <div class="con_block">
            <div class="m_col fl">
                <h1 class="m_tit">图谱数据</h1>
                <div class="m_col_con" id="tpsj_html" style="width:956px;">

                </div>
            </div>
        </div>
    </div>
    <!--主体内容 结束-->

    <!--/*申请方式*/-->
    <div class="fszt_siderbar" style="display: block;">
        <div class="side-btns-closer" style="display: block;">
            <span class="m_show fl">申<br>请<br>方<br>式</span>
            <div class="m_fc fl">
                <span><b style="font-weight:bold; color:#fff;">数据申请方式：</b><br>会员下载</span><br>
                <span><b style="font-weight:bold;color:#fff;">邮箱申请：</b><br>shujushenqing<br>@139.com</span>
            </div>
        </div>
    </div>

    <!-- 底部的版权信息 -->
    <div class="footer inner_c">
        版权所有：国家材料环境腐蚀平台 京ICP备13025191号 京公网安备11010802015897号
    </div>
    <!-- 底部的版权信息 结束-->

    <!-- 数据栏目 -->
    <script type="text/javascript" src="/static/js/edataclass.js"></script>
    <script>
        for (let index = 0; index < edataclass.length; index++) {
            if (edataclass[index].id == 174) { // 腐蚀数据
                var fssj = edataclass[index];
            }
            if (edataclass[index].id == 175) { // 材料数据
                var clsj = edataclass[index];
            }
            if (edataclass[index].id == 176) { // 环境数据
                var hjsj = edataclass[index];
            }
            if (edataclass[index].id == 177) { // 实验数据
                var sysj = edataclass[index];
            }
            if (edataclass[index].id == 245) { // 图谱图集  20191224 改名图集, 178 的暂时不用
                var tpsj = edataclass[index];
            }
            if (edataclass[index].id == 265) { // 基础数据
                var jcsj = edataclass[index];
            }
            if (edataclass[index].id == 380) { // 腐蚀调查
                var fsdc = edataclass[index];
            }
            if (edataclass[index].id == 416) { // 专题数据
                var ztsj = edataclass[index];
            }
        }
        // 腐蚀数据
        var html_str = "";
        for (let i = 0; i < 3; i++) {
            const sj = fssj['children'][i];
            // console.log(sj);
            html_str += '<div class="m_con_child fl" id="fssj_' + i + '" style="height:340px">';
            html_str += '<a href="/edataclass.html?classid=' + sj.id + '" title="' + sj.classname +
                '" target="_blank"><h2 class="m_con_t">' + sj.classname + '</h2></a>';
            html_str += '<ul class="m_con_list">';

            sj["children"].forEach(csj => {
                html_str += '<li style="margin-top:10px">';
                html_str += '<a href="/datalist.html?classid=' + csj.id + '" title="' + csj.classname + '" target="_blank">';
                html_str += '<span class="word">' + csj.classname + '</span>';
                html_str += '<span class="count">'+csj.infos+'</span>';
                html_str += '</a>';
                html_str += '</li>';
            });

            html_str += '</ul>';
            html_str += '</div>';
        }
        $("#fssj").append(html_str);
        $("#fssj_2").css({
            "border-right": "none",
            "margin-right": "0"
        });

        // 环境数据
        var html_str = "";
        for (let i = 0; i < hjsj['children'].length; i++) {
            const sj = hjsj['children'][i];
            html_str += '<li>';
            html_str += '<a href="/edataclass.html?classid=' + sj.id + '" title="' + sj.classname +
                '" target="_blank">' + sj.classname + '</a>';
            html_str += '<div class="con_db fl">';
            sj["children"].forEach(csj => {
                html_str += '<a href="/datalist.html?classid=' + csj.id + '"  title="' + csj.classname + '" target="_blank">';
                html_str += '<span>【' + csj.classname + '】</span>';
                html_str += '<span class="icon f330_0">'+ csj.infos +'</span></a>';
            });
            html_str += '</a></div></li>';
        }
        $("#hjsj ul.clsj").append(html_str);

        // 专题数据
        var html_str = "";
        var qita_html_str =
            '<div class="m_con_child fl" id="ztsj_2"><h2 class="m_con_t">其他专题</h2><ul class="m_con_list"><li>';
        for (let i = 0; i < ztsj['children'].length; i++) {
            const sj = ztsj['children'][i];
            if (sj.id == 419) { // 石油化工
                var sy_html_str = '<div class="m_con_child fl">';
                sy_html_str += '<h2 class="m_con_t">' + sj.classname + '</h2>';
                sy_html_str += '<ul class="m_con_list">';
                sy_html_str += '<li>';

                for (let i = 0; i < 8; i++) {
                    // sj["children"].forEach(csj => {
                    const csj = sj["children"][i];
                    if (csj != null) {
                        sy_html_str += '<a href="/datalist.html?classid=' + csj.id + '" title="' + csj.classname + '" target="_blank">';
                        sy_html_str += '<span class="word">' + csj.classname + '</span>';
                        sy_html_str += '<span class="count">'+ csj.infos +'</span>';
                        sy_html_str += '</a>';
                    }
                    // });
                }
                sy_html_str += '</li>';
                sy_html_str += '</ul>';
                sy_html_str += '</div>';
            } else if (sj.id == 417) { // 海工装备及材料
                var hy_html_str = '<div class="m_con_child fl">';
                hy_html_str += '<h2 class="m_con_t">' + sj.classname + '</h2>';
                hy_html_str += '<ul class="m_con_list">';
                hy_html_str += '<li>';
                sj["children"].forEach(csj => {
                    hy_html_str += '<a href="/datalist.html?classid=' + csj.id + '" title="' + csj
                        .classname + '" target="_blank">';
                    hy_html_str += '<span class="word">' + csj.classname + '</span>';
                    hy_html_str += '<span class="count">'+ csj.infos +'</span>';
                    hy_html_str += '</a>';
                });
                hy_html_str += '</li>';
                hy_html_str += '</ul>';
                hy_html_str += '</div>';
            } else { // 其他
                sj["children"].forEach(csj => {
                    qita_html_str += '<a href="/datalist.html?classid=' + csj.id + '" title="' + csj
                        .classname + '" target="_blank">';
                    qita_html_str += '<span class="word">' + csj.classname + '</span>';
                    qita_html_str += '<span class="count">'+ csj.infos +'</span>';
                    qita_html_str += '</a>';
                });
            }
        }
        qita_html_str += '</li></ul></div>';
        html_str += sy_html_str + hy_html_str + qita_html_str;
        $("#ztsj").append(html_str);
        $("#ztsj_2").css({
            "border-right": "none",
            "margin-right": "0"
        });

        // 腐蚀调查
        var html_str = "";
        for (let i = 0; i < fsdc['children'].length; i++) {
            const sj = fsdc['children'][i];
            html_str += '<div class="m_con_child fl" id="fsdc_' + i + '">';
            html_str += '<h2 class="m_con_t">' + sj.classname;
            html_str += '<a href="/edataclass.html?classid=' + sj.id +
                '" target="_blank" style="float: right;color:#075590;font-size:12px">更多&gt;&gt;</a>';
            html_str += '</h2>';
            html_str += '<ul class="m_con_list">';
            html_str += '<li>';

            for (let i = 0; i < 8; i++) { //  设置只展示前8个class
                // sj["children"].forEach(csj => {
                const csj = sj["children"][i];
                if (csj != null) { // 这点没有foreach 好后面可能少于7 取出来为null, 而且foreach 不能用 break;
                    html_str += '<a href="/datalist.html?classid=' + csj.id + '"  target="_blank">';
                    html_str += '<span class="word">' + csj.classname + '</span>';
                    html_str += '<span class="count">'+ csj.infos +'</span>';
                    html_str += '</a>';
                }
                // });
            }

            html_str += '</li>';
            html_str += '</ul>';
            html_str += '</div>';
        }
        $("#fsdc").append(html_str);
        $("#fsdc_2").css({
            "border-right": "none",
            "margin-right": "0"
        });

        // 材料数据
        var html_str = "";
        for (let i = 0; i < clsj['children'].length; i++) {
            const sj = clsj['children'][i];
            html_str += '<li>';
            html_str += '<a href="javascript:void(0);" target="_blank">' + sj.classname + '</a>';
            sj["children"].forEach(csj => {
                html_str += '<a href="/datalist.html?classid=' + csj.id + '" target="_blank"><span>【' + csj.classname +
                    '】</span></a>';
                html_str += '<span class="count">'+ csj.infos +'</span>'
            });
            html_str += '</a></li>';
        }
        // html_str += '<li><a href="#" target="_blank">更多</a></li>';
        $("#clsj ul.clsj").append(html_str);

        // 基础数据
        var html_str = "";
        // for (let i = 0; i < jcsj['children'].length; i++) {
        for (let i = 0; i < 6; i++) { // 限制展示6条数据
            const sj = jcsj['children'][i];
            html_str += '<li>';
            html_str += '<a href="/datalist.html?classid=' + sj.id + '" target="_blank"><span class="word">' +
                sj.classname + '</span>';
            html_str += '<span class="count">'+ sj.infos +'</span>'
            html_str += '</a></li>';
        }
        $("#jcsj ul").append(html_str);

        // 实验数据
        var html_str = "";
        for (let i = 0; i < sysj['children'].length; i++) {
            const csj = sysj['children'][i];
            csj.children.forEach(sj => {
                html_str += '<li>';
                html_str += '<a href="/datalist.html?classid=' + sj.id + '" target="_blank"><span class="word">' +
                    sj.classname + '</span>';
                html_str += '<span class="count">'+ sj.infos +'</span>'
                html_str += '</a></li>';
            })
        }
        $("#sysj ul").append(html_str);

        // 图谱图集
        var html_str = "";
        for (let i = 0; i < tpsj['children'].length; i++) {
            const sj = tpsj['children'][i];
            html_str += '<fieldset class="tpsj">';
            html_str += '<legend class="lg_1">' + sj.classname + '</legend>';
            html_str += '<div class="tpsj_lunbo"><ul class="tp_lb" data-classid="'+sj.id+'">';
            html_str +='</ul><a class="arrow al"></a><a class="arrow ar"></a></div> </fieldset>';
        }
        $("#tpsj_html").append(html_str);
        html_str = '';
        tpsj = null

        // <!-- 搜索 -->
        option_str = "";
        edataclass.forEach(eclass => {
            // console.log(eclass.children);
            option_str += '<option value="'+eclass.id+'">'+eclass.classname+'</option>';
            eclass.children.forEach(ecl => {
                // console.log(ecl);
                option_str += '<option value="'+ecl.id+'">&nbsp;&nbsp;&nbsp;&nbsp;└'+ecl.classname+'</option>';
                ecl.children.forEach(e => {
                    option_str += '<option value="'+e.id+'">&nbsp;&nbsp;&nbsp;&nbsp;└'+e.classname+'</option>';
                })
            });
        });
        $("#sel_Sub").append(option_str);

        $("#search_button").on("click", function () {
            $('#errmsg').hide();
            var classid = $("#sel_Sub").find("option:selected").val();
            var input_v = $('#search-box').val();
            console.log(classid);
            if (classid=="") {
                $('#errmsg').show().html("<span class='label label-warning'>请选择数据表！</span>");
                return false;
            } else if (input_v=="") {
                $('#errmsg').show().html("<span class='label label-warning'>请输入关键字</span>");
                return false;
            } else {
                self.location.href = '/datalist.html?classid=' + classid + '&q='+input_v;
            }
        });

        /*图谱图集*/
        $("ul.tp_lb").each(function(i){
            var classid=$(this).data("classid");
            // console.log(classid);
            makephotolist(classid, this);
        });

        function makephotolist(classid, obj){
            $.get('/ajax/edata/getplist', {'classid':classid},function(data){
                if (data.success==true) {
                    plist = data.data.photoList.list;
                    
                    list_str = '';
                    for (let j = 0; j < plist.length; j++) {
                        const element = plist[j];
                        // console.log(element);
                        list_str += '<li><a class="wrap_child" href="photo.html?id='+element.id+'" title="'+element.title+'">';
                        list_str += '<img src="/data'+element.titlepic+'" /></li>';
                    }
                    $(obj).append(list_str);
                }
            },'json');
        }



        $("fieldset.tpsj").mouseenter(function () {
            var tpsj = $(this).index();
            //alert(tpsj);
            return lun(tpsj);
        })

        function lun(e) {
            var childs = $(".tpsj").eq(e).find(".wrap_child");
            var aleft = $(".tpsj").eq(e).find(".al");
            var aright = $(".tpsj").eq(e).find(".ar");
            var parent = $(".tpsj").eq(e).find(".tp_lb");
            var imgsmax = childs.length - 1; /*图片数量*/
            var ncount = 0; /*真正图片的初始位置*/
            aleft.click(function () {
                if (ncount > 0) {
                    ncount--;
                    parent.animate({
                        marginLeft: -160 * ncount
                    });
                }
            });
            aright.click(function () {
                if (ncount < imgsmax) {
                    ncount++;
                    /*document.title = ncount;*/
                    parent.animate({
                        marginLeft: -160 * ncount
                    });
                }
            });
        }
        // <!--申请方式-->
        $(".m_show").click(function () {
            $(".m_fc").toggle(500);
        })
    </script>
</body>

</html>